package Demo1;

import java.util.Scanner;

public class demo8 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int a = in.nextInt(),b = in.nextInt();
        for(int num = a;num<b;num++){
            if(!isPow(num)) continue;

            int count = 0,temp = num;
            while(temp!=0){
                count++;
                temp/=10;
            }

            for(int i = 10;i<=Math.pow(10,count-1);i*=10){
                int left = num/i,right = num%i;
                if(right!=0&&isPow(left)&&isPow(right)){
                    System.out.println(num);
                    break;
                }
            }
        }
    }

    public static boolean isPow(int number){
        return Math.sqrt(number)==Math.floor(Math.sqrt(number));
    }
}
